package com.qiu.greened.network

import com.qiu.greened.bean.*
import retrofit2.http.*
import java.util.*
import okhttp3.MultipartBody

import retrofit2.http.Multipart

import retrofit2.http.POST





interface UserService {

    @POST("user/login")
    suspend fun getUserLoginData(@Body userPostBean: UserPostBean): BaseResponse<UserLoginBean>

    @POST("user/register")
    suspend fun getUserRegisterData(@Body userPostBean: UserPostBean): BaseResponse<UserLoginBean>


    @GET("user/{id}")
    suspend fun getUserInfo(@Header("Authorization") token: String,
                            @Path("id") id: Int,
                            @Query("userId") userId: Int
    ) : BaseResponse<UserBean>

//    @GET("user/test")
//    suspend fun getTestMsg(): BaseResponse<Objects>

    @POST("user/follow")
    suspend fun setFollow(@Header("Authorization") token: String,
                          @Body followBean: FollowBean
    ) : BaseResponse<Objects>



    @POST("upload")
    @Multipart
    suspend fun upload(@Header("Authorization") token: String,
                       @Part file: MultipartBody.Part): BaseResponse<Objects>


    @GET("user/{userId}/reply")
    suspend fun getReply(@Header("Authorization") token: String,
                         @Path("userId") userId: Int,
                         @Query("page") page: Int,
                         @Query("limit") limit: Int
    ) : BaseResponse<List<ReplyBean>>


}